<?php
  /*
 * Manager.php
 * Represents a user with Manager permissions
  */
class Manager extends AppModel
{
	var $name = 'Manager';
	var $primaryKey = 'manager_id';
	//validation rules
        var $validate = array(
	'manager_id'=> array(
		'rule'=>'numeric',
		'required'=>true
	),
	'name'=> array(
		'rule'=>'alphaNumeric',
		'required'=>true
	)
    );

  //Managers can join groups to gain hour-editing rights over the group's employee Members
	public $hasAndBelongsToMany = array(
			'Groups' => array(
				'className'              => 'Group',
				'joinTable'              => 'group_managers',
				'foreignKey'             => 'mgr_id',
				'associationForeignKey'  => 'group_id',
				),
			);

}
?>
